home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v2.1 / Amiga Developer CD v2.1.iso / CDTV / cdtvtools-11 / debox / include / debox.h next >
C/C++ Source or Header  |  1991-06-24  |  4KB  |  139 lines

  1. /* :ts=8
  2. *
  3. *   dbox.h - Headers for dbox
  4. *
  5. * William A. Ware                    9005.17
  6. * Name changes to flags.                9010.01    ewhac
  7. *
  8. **
  9. **      Copyright (c) 1991 Commodore Electronics Ltd.
  10. **      All rights reserved. Confidential and Proprietary.
  11. **      CDTV is a trademark of Commodore Electronics Ltd.
  12. **/
  13.  
  14. #ifndef DEBOX_H
  15. #define DEBOX_H
  16.  
  17.  
  18. #ifndef GRAPHICS_VIEW_H
  19. #include <graphics/view.h>
  20. #endif
  21.  
  22.  
  23.  
  24. /*
  25.  * DeBox file types.
  26.  */
  27. #define DEBOXTYPE_UNKNOWN    0    /*  Unspecified data.           */
  28. #define DEBOXTYPE_PIC        1    /*  Picture.               */
  29.  
  30. /*
  31.  * Error codes.
  32.  */
  33. #define DEBOXERR_HEADER        -1    /*  Header is invalid.           */
  34. #define DEBOXERR_DATA        -2    /*  Data has an error in it.       */
  35. #define DEBOXERR_TYPE        -3    /*  Data is the wrong type of file.
  36.                         ie DEBOXTYPE_UNKNOWN instead of
  37.                         DEBOXTYPE_PIC.           */
  38. #define DEBOXERR_MEMORY        -4    /*  Not enough memory to decompress
  39.                         file.               */
  40.  
  41. #define COMPHEADER_SIZE        (sizeof(struct CompHeader))
  42.  
  43. struct CompHeader
  44. {
  45.     UBYTE    ci_Check;    /*  Checksum for the header.        */
  46.     UBYTE    ci_Version;    /*  Version for the compression.    */
  47.     UBYTE    ci_pad;        /*  Reserved for future use.        */
  48.     UBYTE    ci_Type;    /*  Type of data, e.g. DEBOXTYPE_PIC,
  49.                     DEBOXTYPE_UNKNOWN, et al.        */
  50.     ULONG    ci_DataInfo;    /*  Info on data -- for library's use.    */
  51.     LONG    ci_Size;    /*  Size of uncompressed data.        */
  52.     LONG    ci_CSize;    /*  Size of compressed data.        */
  53. };
  54.  
  55.  
  56. /*
  57.  * Notes on BMInfo:
  58.  *
  59.  * bmi_TotalSize:
  60.  *    DecompBMInfo() allocates everything together so there are private
  61.  * parts after this structure.  This is the total size of the entire
  62.  * structure, public and private.
  63.  *
  64.  * bmi_TransparentColor:
  65.  *    If BMIF_TRANSPARENT_COLOR is set in bmi_Flags, then this field can be
  66.  * used to make a mask out of the decompressed bit map.
  67.  */
  68. struct BMInfo
  69. {
  70.     ULONG        bmi_TotalSize;    /*  See notes above.           */
  71.     UWORD        *bmi_ColorMap;    /*  Pointer to an Amiga colormap.  */
  72.     struct RangeInfo    *bmi_RangeInfo; /* Pointer to RangeInfos.  */
  73.     UWORD        bmi_Width,    /*  Dimensions of the picture.       */
  74.             bmi_Height;
  75.     UBYTE        bmi_Depth;    /*  Number of bitplanes.       */
  76.     UBYTE        bmi_Flags;    /*  See below.               */
  77.     UWORD        bmi_Modes;    /*  View modes (HIRES, LACE, etc.) */
  78.     UBYTE        bmi_NumColors;    /*  Number of colors.           */
  79.     UBYTE        bmi_NumRanges;    /*  Number of RangeInfos.       */
  80.     UBYTE        bmi_TransparentColor;    /*  See notes above.       */
  81.     UBYTE        bmi_pad1;    /*  Reserved for future use.       */
  82.     ULONG        bmi_pad2;
  83. };
  84.  
  85. /*
  86.  * BMInfo Flags.
  87.  */
  88. #define BMIF_HAS_COLORS        1    /*  BMInfo has a colormap.       */
  89. #define BMIF_HAS_MASK        (1<<1)    /*  Bitmap has mask plane.       */
  90. #define BMIF_HAS_RANGES        (1<<2)    /*  BMInfo has RangeInfos.       */
  91. #define BMIF_TRANSPARENT_COLOR    (1<<3)    /*  See notes above.           */
  92.  
  93.  
  94. /*
  95.  * Notes on RangeInfo:
  96.  *
  97.  * rgi_Size:
  98.  *    Contains the total size of the RangeInfo structure.  If there is an
  99.  * array of RangeInfos, this value may be used as an offset from the current
  100.  * RangeInfo to the next one in the array.
  101.  *
  102.  * rgi_CArray[]:
  103.  *    It contains color table indicies.  It specifies the order in which
  104.  * colors should be rotated through the colormap.  For example, if rgi_CArray
  105.  * were to contain 1,2,4, you would cycle register 4 into register 2,
  106.  * register 2 into register 1, and register 1 into register 4.
  107.  */
  108. struct RangeInfo
  109. {
  110.     UWORD    rgi_Size;    /*  See notes above.               */
  111.     UBYTE    rgi_Low,    /*  Start the cycle at rgi_CArray[rgi_Low] */
  112.         rgi_High;    /*  and end at rgi_CArray[rgi_High]       */
  113.     BYTE    rgi_Dir;    /*  Direction -- -1:Left, 0:Off, 1: Right  */
  114.     UBYTE    rgi_Flags;    /*  Flags (none defined as of yet).       */
  115.     UWORD    rgi_Seconds;    /*  Time between each cycle.           */
  116.     ULONG    rgi_MicroSeconds;
  117.     UWORD    rgi_SecondsLeft;/*  Countdown variables.           */
  118.     ULONG    rgi_MicroLeft;    /*  Both modified by CycleRanges().       */
  119.     ULONG    rgi_reserved;
  120.     UBYTE    rgi_CArray[32];    /*  See notes above.               */
  121. };
  122.  
  123.  
  124. struct SuperView
  125. {
  126.     struct View    sv_View;
  127.     struct ViewPort    sv_ViewPort;
  128.     struct RasInfo    sv_RasInfo;
  129.     LONG        sv_Flags;
  130. };
  131.  
  132. /*
  133.  * SuperView Flags.
  134.  */
  135. #define SVF_ALLOCATED    1    /* This structure created by CreateView(). */
  136.  
  137.  
  138. #endif
  139.